﻿using OnlineOrder.Entity;
using OnlineOrder.UI.用户窗体;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineOrder.UI
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            this.toolStripLabel2.Text = Middle.a;


        }

      

        private void 美食分类ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Foods foods = new Foods();
            foods.MdiParent = this;
            foods.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }

        private void 菜式分类ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Dishes dishes = new Dishes();
            dishes.MdiParent = this;
            dishes.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }

     private void 个人信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PersonalInformation pI = new PersonalInformation();
            pI.MdiParent = this;
            pI.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }

        

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            ShoppingCar car = new ShoppingCar();
            car.MdiParent = this;
            car.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }

        private void 私信ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SocketClient socketClient = new SocketClient();
            socketClient.ShowDialog();
        }

        private void 打印订单信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DingDan dingDan = new DingDan();
            Middle.a =this.toolStripLabel2.Text;
            dingDan.MdiParent = this;
            dingDan.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }
    }
}
